﻿namespace WMS6.Web.Inventory
{
    using System;
    using System.Web.UI.HtmlControls;
    using System.Web.UI.WebControls;
    using WMS6.Web;
    using WMS6.Web.UserControls;

    public class PCRequestQuery : BasePage
    {
        protected Button btnExport;
        protected Button btnList;
        protected Button btnNew;
        protected Button btnSearch;
        protected DropDownList ddlAreaIDEnd;
        protected DropDownList ddlAreaIDStart;
        protected DropDownList ddlLocEnd;
        protected DropDownList ddlLocLevelEnd;
        protected DropDownList ddlLocLevelStart;
        protected DropDownList ddlLocStart;
        protected DropDownList ddlOwnerIDEnd;
        protected DropDownList ddlOwnerIDStart;
        protected DropDownList ddlPhysicalRequestID;
        protected DropDownList ddlSkuIDEnd;
        protected DropDownList ddlSkuIDStart;
        protected DropDownList ddlStatusOper;
        protected DropDownList ddlZoneIDEnd;
        protected DropDownList ddlZoneIDStart;
        protected HtmlForm F5540;
        protected HtmlInputHidden hdnActionID;
        protected Label lblAreaIDEnd;
        protected Label lblAreaIDStart;
        protected Label lblLocEnd;
        protected Label lblLocLevelEnd;
        protected Label lblLocLevelStart;
        protected Label lblLocStart;
        protected Label lblOwnerIDEnd;
        protected Label lblOwnerIDStart;
        protected Label lblPhysicalRequestID;
        protected Label lblReceiptQuery;
        protected Label lblSkuIDEnd;
        protected Label lblSkuIDStart;
        protected Label lblStatus;
        protected Label lblZoneIDEnd;
        protected Label lblZoneIDStart;
        protected MultipleSelectControl MSCStatus;
        protected HtmlLink mycss;
        protected TextBox txtAreaIDEnd;
        protected TextBox txtAreaIDStart;
        protected TextBox txtLocEnd;
        protected TextBox txtLocLevelEnd;
        protected TextBox txtLocLevelStart;
        protected TextBox txtLocStart;
        protected TextBox txtOwnerIDEnd;
        protected TextBox txtOwnerIDStart;
        protected TextBox txtPhysicalRequestID;
        protected TextBox txtSkuIDEnd;
        protected TextBox txtSkuIDStart;
        protected TextBox txtZoneIDEnd;
        protected TextBox txtZoneIDStart;

        protected void btnSearch_Click(object sender, EventArgs e)
        {
            base.Server.Transfer("PCRequestList.aspx", false);
        }

        private void InitDropDownLists()
        {
            base.InitQueryDDL(this.ddlAreaIDEnd, 0);
            base.InitQueryDDL(this.ddlAreaIDStart, 0);
            base.InitQueryDDL(this.ddlLocEnd, 0);
            base.InitQueryDDL(this.ddlLocStart, 0);
            base.InitQueryDDL(this.ddlOwnerIDEnd, 0);
            base.InitQueryDDL(this.ddlOwnerIDStart, 0);
            base.InitQueryDDL(this.ddlPhysicalRequestID, 0);
            base.InitQueryDDL(this.ddlLocLevelEnd, 0);
            base.InitQueryDDL(this.ddlLocLevelStart, 0);
            base.InitQueryDDL(this.ddlSkuIDEnd, 0);
            base.InitQueryDDL(this.ddlSkuIDStart, 0);
            base.InitQueryDDL(this.ddlStatusOper, 0);
            base.InitQueryDDL(this.ddlZoneIDEnd, 0);
            base.InitQueryDDL(this.ddlZoneIDStart, 0);
            base.BindData2DDLBySysCode(this.MSCStatus, "PCStatus");
            this.ddlStatusOper.SelectedValue = "One Of";
        }

        protected void Page_Load(object sender, EventArgs e)
        {
            if (!base.IsPostBack)
            {
                base.InitPage(this.Page);
                this.InitDropDownLists();
            }
        }

        public string AreaIDEnd
        {
            get
            {
                if (!string.IsNullOrEmpty(this.txtAreaIDEnd.Text.Trim()))
                {
                    return base.GetParamsString(this.txtAreaIDEnd.Text.Trim(), this.ddlAreaIDEnd.SelectedValue);
                }
                return "";
            }
        }

        public string AreaIDStart
        {
            get
            {
                if (!string.IsNullOrEmpty(this.txtAreaIDStart.Text.Trim()))
                {
                    return base.GetParamsString(this.txtAreaIDStart.Text.Trim(), this.ddlAreaIDStart.SelectedValue);
                }
                return "";
            }
        }

        public string LocEnd
        {
            get
            {
                if (!string.IsNullOrEmpty(this.txtLocEnd.Text.Trim()))
                {
                    return base.GetParamsString(this.txtLocEnd.Text.Trim(), this.ddlLocEnd.SelectedValue);
                }
                return "";
            }
        }

        public string LocLevelEnd
        {
            get
            {
                if (!string.IsNullOrEmpty(this.txtLocLevelEnd.Text.Trim()))
                {
                    return base.GetParamsString(this.txtLocLevelEnd.Text.Trim(), this.ddlLocLevelEnd.SelectedValue);
                }
                return "";
            }
        }

        public string LocLevelStart
        {
            get
            {
                if (!string.IsNullOrEmpty(this.txtLocLevelStart.Text.Trim()))
                {
                    return base.GetParamsString(this.txtLocLevelStart.Text.Trim(), this.ddlLocLevelStart.SelectedValue);
                }
                return "";
            }
        }

        public string LocStart
        {
            get
            {
                if (!string.IsNullOrEmpty(this.txtLocStart.Text.Trim()))
                {
                    return base.GetParamsString(this.txtLocStart.Text.Trim(), this.ddlLocStart.SelectedValue);
                }
                return "";
            }
        }

        public string OwnerIDEnd
        {
            get
            {
                if (!string.IsNullOrEmpty(this.txtOwnerIDEnd.Text.Trim()))
                {
                    return base.GetParamsString(this.txtOwnerIDEnd.Text.Trim(), this.ddlOwnerIDEnd.SelectedValue);
                }
                return "";
            }
        }

        public string OwnerIDStart
        {
            get
            {
                if (!string.IsNullOrEmpty(this.txtOwnerIDStart.Text.Trim()))
                {
                    return base.GetParamsString(this.txtOwnerIDStart.Text.Trim(), this.ddlOwnerIDStart.SelectedValue);
                }
                return "";
            }
        }

        public string PhysicalRequestID
        {
            get
            {
                if (!string.IsNullOrEmpty(this.txtPhysicalRequestID.Text.Trim()))
                {
                    return base.GetParamsString(this.txtPhysicalRequestID.Text.Trim(), this.ddlPhysicalRequestID.SelectedValue);
                }
                return "";
            }
        }

        public string SkuIDEnd
        {
            get
            {
                if (!string.IsNullOrEmpty(this.txtSkuIDEnd.Text.Trim()))
                {
                    return base.GetParamsString(this.txtSkuIDEnd.Text.Trim(), this.ddlSkuIDEnd.SelectedValue);
                }
                return "";
            }
        }

        public string SkuIDStart
        {
            get
            {
                if (!string.IsNullOrEmpty(this.txtSkuIDStart.Text.Trim()))
                {
                    return base.GetParamsString(this.txtSkuIDStart.Text.Trim(), this.ddlSkuIDStart.SelectedValue);
                }
                return "";
            }
        }

        public string Status
        {
            get
            {
                if (!string.IsNullOrEmpty(this.MSCStatus.ReturnValue))
                {
                    return base.GetParamsString(this.MSCStatus.ReturnValue, this.ddlStatusOper.SelectedValue);
                }
                return "";
            }
        }

        public string ZoneIDEnd
        {
            get
            {
                if (!string.IsNullOrEmpty(this.txtZoneIDEnd.Text.Trim()))
                {
                    return base.GetParamsString(this.txtZoneIDEnd.Text.Trim(), this.ddlZoneIDEnd.SelectedValue);
                }
                return "";
            }
        }

        public string ZoneIDStart
        {
            get
            {
                if (!string.IsNullOrEmpty(this.txtZoneIDStart.Text.Trim()))
                {
                    return base.GetParamsString(this.txtZoneIDStart.Text.Trim(), this.ddlZoneIDStart.SelectedValue);
                }
                return "";
            }
        }
    }
}

